﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace PROJECT_BOMBER.BLL
{
    public class CharacterAnimation : DefaultAnimation
    {
        #region Contructeur

        /// <summary>
        /// Initializes a new instance of the <see cref="CharacterAnimation"/> class. 
        /// List of all character's animation
        /// </summary>
        /// <param name="character">The character.</param>
        public CharacterAnimation(Character character) : base(character) { }

        #endregion

        #region dead

        AnimationSprite _dead;
        /// <summary>
        /// get the sprite dead.
        /// </summary>
        /// <returns></returns>
        public AnimationSprite Dead()
        {
            return _dead;
        }

        /// <summary>
        /// set the sprite dead.
        /// </summary>
        /// <param name="sprite">The sprite.</param>
        public void Dead(AnimationSprite sprite)
        {
            _dead = sprite;
        }

        /// <summary>
        /// Change position  
        /// </summary>
        /// <param name="anim">The anim.</param>
        /// <param name="game">The game.</param>
        public void Dead(AnimationDefinition anim, Game game)
        {
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _dead = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region up

        AnimationSprite _up;
        /// <summary>
        /// get the sprite up
        /// </summary>
        /// <returns></returns>
        public AnimationSprite Up()
        {
            return _up;
        }

        /// <summary>
        /// set the sprite up
        /// </summary>
        /// <param name="sprite">The sprite.</param>
        public void Up(AnimationSprite sprite)
        {
            _up = sprite;
        }

        /// <summary>
        /// Action executed where the character is dead.
        /// </summary>
        /// <param name="anim">The anim.</param>
        /// <param name="game">The game.</param>
        public void Up(AnimationDefinition anim, Game game)
        {
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _up = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region down
        AnimationSprite _down;
        public AnimationSprite Down()
        {
            return _down;
        }

        public void Down(AnimationSprite sprite)
        {
            _down = sprite;
        }

        public void Down(AnimationDefinition anim, Game game)
        {
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _down = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region face
        AnimationSprite _face;
        public AnimationSprite Face()
        {
            return _face;
        }

        public void Face(AnimationSprite sprite)
        {
            _face = sprite;
        }

        public void Face(AnimationDefinition anim, Game game)
        {
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _face = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region attack
        AnimationSprite _attack;
        public AnimationSprite Attack()
        {
            return _attack;
        }

        public void Attack(AnimationSprite sprite)
        {
            _attack = sprite;
        }

        public void Attack(AnimationDefinition anim, Game game)
        {

            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _attack = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region fly
        AnimationSprite _fly;
        public AnimationSprite Fly()
        {
            return _fly;
        }

        public void Fly(AnimationSprite sprite)
        {
            _fly = sprite;
        }

        public void Fly(AnimationDefinition anim, Game game)
        {
            
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _fly = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region spring left
        AnimationSprite _sprintleft;
        public AnimationSprite Sprintleft()
        {
            return _sprintleft;
        }

        public void Sprintleft(AnimationSprite sprite)
        {
            _sprintleft = sprite;
        }

        public void Sprintleft(AnimationDefinition anim, Game game)
        {
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _sprintleft = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

        #region spring right
        AnimationSprite _sprintright;
        public AnimationSprite Sprintright()
        {
            return _sprintright;
        }

        public void Sprintright(AnimationSprite sprite)
        {
            _sprintright = sprite;
        }

        public void Sprintright(AnimationDefinition anim, Game game)
        {
            Element.Width = anim.FrameSize.X;
            Element.Height = anim.FrameSize.Y;
            _sprintright = new AnimationSprite(game, anim);
            Base().Position = new Point((int)Element.Positionbase.X, (int)Element.Positionbase.Y);
        }
        #endregion

    }
}
